<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: Initialization and de-initialization Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('group___h_a_l___group1.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">Initialization and de-initialization Functions <div class="ingroups"><a class="el" href="group___s_t_m32_h7xx___h_a_l___driver.html">STM32H7xx_HAL_Driver</a> &raquo; <a class="el" href="group___h_a_l.html">HAL</a> &raquo; <a class="el" href="group___h_a_l___exported___functions.html">HAL Exported Functions</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Initialization and de-initialization functions.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaecac54d350c3730e6831eb404e557dc4" id="r_gaecac54d350c3730e6831eb404e557dc4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gaecac54d350c3730e6831eb404e557dc4">HAL_Init</a> (void)</td></tr>
<tr class="memdesc:gaecac54d350c3730e6831eb404e557dc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to initialize the HAL Library; it must be the first instruction to be executed in the main program (before to call any other HAL function), it performs the following: Configures the SysTick to generate an interrupt each 1 millisecond, which is clocked by the HSI (at this stage, the clock is not yet configured and thus the system is running from the internal HSI at 16 MHz). Set NVIC Group Priority to 4. Calls the <a class="el" href="stm32h7xx__hal__msp_8c.html#gae4fb8e66865c87d0ebab74a726a6891f" title="Initializes the MSP.">HAL_MspInit()</a> callback function defined in user file "stm32h7xx_hal_msp.c" to do the global low level hardware initialization.  <br /></td></tr>
<tr class="memitem:ga95911129a26afb05232caaaefa31956f" id="r_ga95911129a26afb05232caaaefa31956f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga95911129a26afb05232caaaefa31956f">HAL_DeInit</a> (void)</td></tr>
<tr class="memdesc:ga95911129a26afb05232caaaefa31956f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function de-Initializes common part of the HAL and stops the systick. This function is optional.  <br /></td></tr>
<tr class="memitem:gae4fb8e66865c87d0ebab74a726a6891f" id="r_gae4fb8e66865c87d0ebab74a726a6891f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gae4fb8e66865c87d0ebab74a726a6891f">HAL_MspInit</a> (void)</td></tr>
<tr class="memdesc:gae4fb8e66865c87d0ebab74a726a6891f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the MSP.  <br /></td></tr>
<tr class="memitem:gaa2d4540edcb9dacec34edb77f3455bf0" id="r_gaa2d4540edcb9dacec34edb77f3455bf0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa2d4540edcb9dacec34edb77f3455bf0">HAL_MspDeInit</a> (void)</td></tr>
<tr class="memdesc:gaa2d4540edcb9dacec34edb77f3455bf0"><td class="mdescLeft">&#160;</td><td class="mdescRight">DeInitializes the MSP.  <br /></td></tr>
<tr class="memitem:ga879cdb21ef051eb81ec51c18147397d5" id="r_ga879cdb21ef051eb81ec51c18147397d5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga879cdb21ef051eb81ec51c18147397d5">HAL_InitTick</a> (uint32_t TickPriority)</td></tr>
<tr class="memdesc:ga879cdb21ef051eb81ec51c18147397d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function configures the source of the time base. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority.  <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<p>Initialization and de-initialization functions. </p>
<pre class="fragment"> ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Initializes the Flash interface the NVIC allocation and initial clock
          configuration. It initializes the systick also when timeout is needed
          and the backup domain when enabled.
      (+) De-Initializes common part of the HAL.
      (+) Configure The time base source to have 1ms time base with a dedicated
          Tick interrupt priority.
        (++) SysTick timer is used by default as source of time base, but user
             can eventually implement his proper time base source (a general purpose
             timer for example or other time source), keeping in mind that Time base
             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
             handled in milliseconds basis.
        (++) Time base configuration function (HAL_InitTick ()) is called automatically
             at the beginning of the program after reset by HAL_Init() or at any time
             when clock is configured, by HAL_RCC_ClockConfig().
        (++) Source of time base is configured  to generate interrupts at regular
             time intervals. Care must be taken if HAL_Delay() is called from a
             peripheral ISR process, the Tick interrupt line must have higher priority
            (numerically lower) than the peripheral interrupt. Otherwise the caller
            ISR process will be blocked.
       (++) functions affecting time base configurations are declared as __weak
             to make  override possible  in case of other  implementations in user file.
</pre> <a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="ga95911129a26afb05232caaaefa31956f" name="ga95911129a26afb05232caaaefa31956f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga95911129a26afb05232caaaefa31956f">&#9670;&#160;</a></span>HAL_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a> HAL_DeInit </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function de-Initializes common part of the HAL and stops the systick. This function is optional. </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">HAL</td><td>status </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaecac54d350c3730e6831eb404e557dc4" name="gaecac54d350c3730e6831eb404e557dc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecac54d350c3730e6831eb404e557dc4">&#9670;&#160;</a></span>HAL_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a> HAL_Init </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to initialize the HAL Library; it must be the first instruction to be executed in the main program (before to call any other HAL function), it performs the following: Configures the SysTick to generate an interrupt each 1 millisecond, which is clocked by the HSI (at this stage, the clock is not yet configured and thus the system is running from the internal HSI at 16 MHz). Set NVIC Group Priority to 4. Calls the <a class="el" href="stm32h7xx__hal__msp_8c.html#gae4fb8e66865c87d0ebab74a726a6891f" title="Initializes the MSP.">HAL_MspInit()</a> callback function defined in user file "stm32h7xx_hal_msp.c" to do the global low level hardware initialization. </p>
<dl class="section note"><dt>Note</dt><dd>SysTick is used as time base for the <a class="el" href="group___h_a_l___group2.html#gab1dc1e6b438daacfe38a312a90221330" title="This function provides minimum delay (in milliseconds) based on variable incremented.">HAL_Delay()</a> function, the application need to ensure that the SysTick time base is always set to 1 millisecond to have correct HAL operation. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">HAL</td><td>status </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga879cdb21ef051eb81ec51c18147397d5" name="ga879cdb21ef051eb81ec51c18147397d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga879cdb21ef051eb81ec51c18147397d5">&#9670;&#160;</a></span>HAL_InitTick()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stm32h7xx__hal__def_8h.html#a63c0679d1cb8b8c684fbb0632743478f">HAL_StatusTypeDef</a> HAL_InitTick </td>
          <td>(</td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>TickPriority</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function configures the source of the time base. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority. </p>
<dl class="section note"><dt>Note</dt><dd>This function is called automatically at the beginning of program after reset by <a class="el" href="#gaecac54d350c3730e6831eb404e557dc4" title="This function is used to initialize the HAL Library; it must be the first instruction to be executed ...">HAL_Init()</a> or at any time when clock is reconfigured by HAL_RCC_ClockConfig(). </dd>
<dd>
In the default implementation, SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Care must be taken if <a class="el" href="group___h_a_l___group2.html#gab1dc1e6b438daacfe38a312a90221330" title="This function provides minimum delay (in milliseconds) based on variable incremented.">HAL_Delay()</a> is called from a peripheral ISR process, the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. The function is declared as __weak to be overwritten in case of other implementation in user file. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">TickPriority</td><td>Tick interrupt priority. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">HAL</td><td>status </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaa2d4540edcb9dacec34edb77f3455bf0" name="gaa2d4540edcb9dacec34edb77f3455bf0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa2d4540edcb9dacec34edb77f3455bf0">&#9670;&#160;</a></span>HAL_MspDeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__weak void HAL_MspDeInit </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>DeInitializes the MSP. </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae4fb8e66865c87d0ebab74a726a6891f" name="gae4fb8e66865c87d0ebab74a726a6891f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae4fb8e66865c87d0ebab74a726a6891f">&#9670;&#160;</a></span>HAL_MspInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HAL_MspInit </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the MSP. </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
